import DashView from './components/Dash.vue'
import MyDashView from './components/MyDash.vue'
import LoginView from './components/Login.vue'
import NotFoundView from './components/404.vue'
// import AppView from './components/App.vue'

// Import Views - Dash
import DashboardView from './components/views/Dashboard.vue'
import TablesView from './components/views/Tables.vue'
import TasksView from './components/views/Tasks.vue'
import SettingView from './components/views/Setting.vue'
import AccessView from './components/views/Access.vue'
import ServerView from './components/views/Server.vue'
import ReposView from './components/views/Repos.vue'
import UserDistributionView from './components/views/UserDistribution.vue'
import OrderView from './components/views/Order.vue'
import FunctionView from './components/views/Function.vue'
import AppLoginView from './components/views/AppLogin.vue'
import OrderAttriView from './components/views/order/Attri.vue'
import OrderClothesView from './components/views/order/Clothes.vue'
import OrderPayView from './components/views/order/Pay.vue'
import DeviceUseView from './components/views/DeviceUse.vue'
import DevNewView from './components/views/DevNew.vue'
import AccountNewView from './components/views/account/New.vue'
import AccountRemainView from './components/views/account/Remain.vue'

// Routes
const routes = [
  {
    path: '/login',
    component: LoginView
  },
  {
    path: '/display',
    component: MyDashView,
    meta: { requiresAuth: true },
    name: 'display',
    children: [
      {
        path: 'al',
        component: AppLoginView,
        name: 'app_login',
        meta: {description: '用户登陆数据展示'}
      },
      {
        path: 'ud',
        component: UserDistributionView,
        name: 'user_distribution',
        meta: {description: '用户分布数据预览'}
      },
      {
        path: 'o',
        component: OrderView,
        name: 'order',
        meta: {description: '订单数据预览'}
      },
      {
        path: 'op',
        component: OrderPayView,
        name: 'order_pay',
        meta: {description: '订单价格梯度'}
      },
      {
        path: 'oa',
        component: OrderAttriView,
        name: 'order_attri',
        meta: {description: '面辅料属性分析'}
      },
      {
        path: 'fc',
        component: FunctionView,
        name: 'function',
        meta: {description: '面料功能数据预览'}
      },
      {
        path: 'du',
        component: DeviceUseView,
        name: 'device_use',
        meta: {description: '设备使用数据预览'}
      },
      {
        path: 'dn',
        component: DevNewView,
        name: 'device_new',
        meta: {description: '设备新增及活跃数据统计'}
      },
      {
        path: 'an',
        component: AccountNewView,
        name: 'account_new',
        meta: {description: '账号新增及活跃数据统计'}
      },
      {
        path: 'ar',
        component: AccountRemainView,
        name: 'account_remain',
        meta: {description: '账号留存数据统计'}
      },
      {
        path: 'oc',
        component: OrderClothesView,
        name: 'order_clothes',
        meta: {description: '成衣属性分析'}
      }
    ]
  },
  {
    path: '/',
    component: DashView,
    meta: { requiresAuth: true },
    children: [
      {
        path: 'dashboard',
        alias: '',
        component: DashboardView,
        name: 'Dashboard',
        meta: {description: 'Overview of environment'}
      }, {
        path: 'tables',
        component: TablesView,
        name: 'Tables',
        meta: {description: 'Simple and advance table in CoPilot'}
      }, {
        path: 'tasks',
        component: TasksView,
        name: 'Tasks',
        meta: {description: 'Tasks page in the form of a timeline'}
      }, {
        path: 'setting',
        component: SettingView,
        name: 'Settings',
        meta: {description: 'User settings page'}
      }, {
        path: 'access',
        component: AccessView,
        name: 'Access',
        meta: {description: 'Example of using maps'}
      }, {
        path: 'server',
        component: ServerView,
        name: 'Servers',
        meta: {description: 'List of our servers'}
      }, {
        path: 'repos',
        component: ReposView,
        name: 'Repository',
        meta: {description: 'List of popular javascript repos'}
      }
    ]
  }, {
    // not found handler
    path: '*',
    component: NotFoundView
  }
]

export default routes
